/*
 * Copyright 2012 Benoît Combe <benoit.combe@gmail.com>.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package fr.ipst.spot.entites.utils;

/**
 *
 * @author Benoît Combe <benoit.combe@gmail.com>
 */
public enum Departement {

    /**
     *
     */
    ain(0, "1", "Ain", 0),
    /**
     *
     */
    aisne(1, "2", "Aisne", 1),
    /**
     *
     */
    allier(2, "3", "Allier", 2),
    /**
     *
     */
    alpes_de_haute_provence(3, "4", "Alpes-de-Haute-Provence", 3),
    /**
     *
     */
    hautes_alpes(4, "5", "Hautes-Alpes", 4),
    /**
     *
     */
    alpes_maritimes(5, "6", "Alpes-Maritimes", 5),
    /**
     *
     */
    ardeche(6, "7", "Ardèche", 6),
    /**
     *
     */
    ardennes(7, "8", "Ardennes", 7),
    /**
     *
     */
    ariege(8, "9", "Ariège", 8),
    /**
     *
     */
    aube(9, "10", "Aube", 9),
    /**
     *
     */
    aude(10, "11", "Aude", 10),
    /**
     *
     */
    aveyron(11, "12", "Aveyron", 11),
    /**
     *
     */
    bouches_du_rhone(12, "13", "Bouches-du-Rhône", 12),
    /**
     *
     */
    calvados(13, "14", "Calvados", 13),
    /**
     *
     */
    cantal(14, "15", "Cantal", 14),
    /**
     *
     */
    charente(15, "16", "Charente", 15),
    /**
     *
     */
    charente_maritime(16, "17", "Charente-Maritime", 16),
    /**
     *
     */
    cher(17, "18", "Cher", 17),
    /**
     *
     */
    correze(18, "19", "Corrèze", 18),
    /**
     *
     */
    corse_du_sud(19, "2A", "Corse-du-Sud", 19),
    /**
     *
     */
    haute_corse(20, "2B", "Haute-Corse", 20),
    /**
     *
     */
    cote_d_or(21, "21", "Côte-d'Or", 21),
    /**
     *
     */
    cotes_d_armor(22, "22", "Côtes-d'Armor", 22),
    /**
     *
     */
    creuse(23, "23", "Creuse", 23),
    /**
     *
     */
    dordogne(24, "24", "Dordogne", 24),
    /**
     *
     */
    doubs(25, "25", "Doubs", 25),
    /**
     *
     */
    drome(26, "26", "Drôme", 26),
    /**
     *
     */
    eure(27, "27", "Eure", 27),
    /**
     *
     */
    eure_et_loir(28, "28", "Eure-et-Loir", 28),
    /**
     *
     */
    finistere(29, "29", "Finistère", 29),
    /**
     *
     */
    gard(30, "30", "Gard", 30),
    /**
     *
     */
    haute_garonne(31, "31", "Haute-Garonne", 31),
    /**
     *
     */
    gers(32, "32", "Gers", 32),
    /**
     *
     */
    gironde(33, "33", "Gironde", 33),
    /**
     *
     */
    herault(34, "34", "Hérault", 34),
    /**
     *
     */
    ille_et_vilaine(35, "35", "Ille-et-Vilaine", 35),
    /**
     *
     */
    indre(36, "36", "Indre", 36),
    /**
     *
     */
    indre_et_loire(37, "37", "Indre-et-Loire", 37),
    /**
     *
     */
    isere(38, "38", "Isère", 38),
    /**
     *
     */
    jura(39, "39", "Jura", 39),
    /**
     *
     */
    landes(40, "40", "Landes", 40),
    /**
     *
     */
    loir_et_cher(41, "41", "Loir-et-Cher", 41),
    /**
     *
     */
    loire(42, "42", "Loire", 42),
    /**
     *
     */
    haute_loire(43, "43", "Haute-Loire", 43),
    /**
     *
     */
    loire_atlantique(44, "44", "Loire-Atlantique", 44),
    /**
     *
     */
    loiret(45, "45", "Loiret", 45),
    /**
     *
     */
    lot(46, "46", "Lot", 46),
    /**
     *
     */
    lot_et_garonne(47, "47", "Lot-et-Garonne", 47),
    /**
     *
     */
    lozere(48, "48", "Lozère", 48),
    /**
     *
     */
    maine_et_loire(49, "49", "Maine-et-Loire", 49),
    /**
     *
     */
    manche(50, "50", "Manche", 50),
    /**
     *
     */
    marne(51, "51", "Marne", 51),
    /**
     *
     */
    haute_marne(52, "52", "Haute-Marne", 52),
    /**
     *
     */
    mayenne(53, "53", "Mayenne", 53),
    /**
     *
     */
    meurthe_et_moselle(54, "54", "Meurthe-et-Moselle", 54),
    /**
     *
     */
    meuse(55, "55", "Meuse", 55),
    /**
     *
     */
    morbihan(56, "56", "Morbihan", 56),
    /**
     *
     */
    moselle(57, "57", "Moselle", 57),
    /**
     *
     */
    nievre(58, "58", "Nièvre", 58),
    /**
     *
     */
    nord(59, "59", "Nord", 59),
    /**
     *
     */
    oise(60, "60", "Oise", 60),
    /**
     *
     */
    orne(61, "61", "Orne", 61),
    /**
     *
     */
    pas_de_calais(62, "62", "Pas-de-Calais", 62),
    /**
     *
     */
    puy_de_dome(63, "63", "Puy-de-Dôme", 63),
    /**
     *
     */
    pyrenees_atlantiques(64, "64", "Pyrénées-Atlantiques", 64),
    /**
     *
     */
    hautes_pyrenees(65, "65", "Hautes-Pyrénées", 65),
    /**
     *
     */
    pyrenees_orientales(66, "66", "Pyrénées-Orientales", 66),
    /**
     *
     */
    bas_rhin(67, "67", "Bas-Rhin", 67),
    /**
     *
     */
    haut_rhin(68, "68", "Haut-Rhin", 68),
    /**
     *
     */
    rhone(69, "69", "Rhône", 69),
    /**
     *
     */
    haute_saone(70, "70", "Haute-Saône", 70),
    /**
     *
     */
    saone_et_loire(71, "71", "Saône-et-Loire", 71),
    /**
     *
     */
    sarthe(72, "72", "Sarthe", 72),
    /**
     *
     */
    savoie(73, "73", "Savoie", 73),
    /**
     *
     */
    haute_savoie(74, "74", "Haute-Savoie", 74),
    /**
     *
     */
    paris(75, "75", "Paris", 75),
    /**
     *
     */
    seine_maritime(76, "76", "Seine-Maritime", 76),
    /**
     *
     */
    seine_et_marne(77, "77", "Seine-et-Marne", 77),
    /**
     *
     */
    yvelines(78, "78", "Yvelines", 78),
    /**
     *
     */
    deux_sevres(79, "79", "Deux-Sèvres", 79),
    /**
     *
     */
    somme(80, "80", "Somme", 80),
    /**
     *
     */
    tarn(81, "81", "Tarn", 81),
    /**
     *
     */
    tarn_et_garonne(82, "82", "Tarn-et-Garonne", 82),
    /**
     *
     */
    var(83, "83", "Var", 83),
    /**
     *
     */
    vaucluse(84, "84", "Vaucluse", 84),
    /**
     *
     */
    vendee(85, "85", "Vendée", 85),
    /**
     *
     */
    vienne(86, "86", "Vienne", 86),
    /**
     *
     */
    haute_vienne(87, "87", "Haute-Vienne", 87),
    /**
     *
     */
    vosges(88, "88", "Vosges", 88),
    /**
     *
     */
    yonne(89, "89", "Yonne", 89),
    /**
     *
     */
    territoire_de_belfort(90, "90", "Territoire de Belfort", 90),
    /**
     *
     */
    essonne(91, "91", "Essonne", 91),
    /**
     *
     */
    hauts_de_seine(92, "92", "Hauts-de-Seine", 92),
    /**
     *
     */
    seine_saint_denis(93, "93", "Seine-Saint-Denis", 93),
    /**
     *
     */
    val_de_marne(94, "94", "Val-de-Marne", 94),
    /**
     *
     */
    val_d_oise(95, "95", "Val-d'Oise", 95),
    /**
     *
     */
    guadeloupe(96, "971", "Guadeloupe", 96),
    /**
     *
     */
    martinique(97, "972", "Martinique", 97),
    /**
     *
     */
    guyane(98, "973", "Guyane", 98),
    /**
     *
     */
    la_reunion(99, "974", "La Réunion", 99),
    /**
     *
     */
    mayotte(100, "976", "Mayotte", 100);
    private Integer codeSql;
    private String numDpt;
    private String nomDpt;
    private Integer codeGescicca;

    private Departement(Integer codeSql, String numDpt, String nomDpt, Integer codeGescicca) {
        this.codeSql = codeSql;
        this.numDpt = numDpt;
        this.nomDpt = nomDpt;
        this.codeGescicca = codeGescicca;
    }

    /**
     *
     * @return
     */
    public Integer getCodeGescicca() {
        return codeGescicca;
    }

    /**
     *
     * @return
     */
    public Integer getCodeSql() {
        return codeSql;
    }

    /**
     *
     * @return
     */
    public String getNomDpt() {
        return nomDpt;
    }

    /**
     *
     * @return
     */
    public String getNumDpt() {
        return numDpt;
    }

    @Override
    public String toString() {
        return this.numDpt + " - " + this.nomDpt;
    }

    /**
     *
     * @param codeSql
     * @return
     */
    public static Departement getDepartementbyCodeSql(Integer codeSql) {
        try {
            return Departement.values()[codeSql];
        } catch (IndexOutOfBoundsException e) {
            return null;
        }
    }
}
